package pk.nak.utils;
import java.net.URL;
import java.util.ArrayList;

import android.graphics.Bitmap;
import android.graphics.BitmapFactory;

public class FormattingUtils {
	public static String IntoDBFormat(String parm){
		return "'"+parm+"'";
	}
	
	public static String getJoin(ArrayList<String> parm,String joiner){
		String res = "";
		for (String s:parm){
			if ( res.compareTo("") != 0 ){
				res += joiner;
			}
			res += s;
		}
		return res;
	}
	public static Bitmap loadBitmap(String url) throws Exception {
		try{
			URL newurl = new URL(url); 
			return BitmapFactory.decodeStream(newurl.openConnection() .getInputStream()); 
		}catch(Exception ex){
			throw ex;
		}
	}
}
